package com.study.eurekaclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.*;

@RestController
@EnableEurekaClient
@SpringBootApplication
public class EurekaClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(EurekaClientApplication.class, args);
    }

    @Value("${server.port}")
    private String port;

    @GetMapping("/testClient/get")
    public String clientTest(){
        return "from testClient:".concat(port);
    }

    @PostMapping("/testClient/post/{gender}")
    public String clientTestPost(@PathVariable String gender, @RequestBody User user){
        user.setGender(gender);
        return user.toString();
    }

}
